#include<iostream>
#include<stdio.h>
#include<algorithm>
using namespace std;

struct all{
	int number;
	string name;
	double money;
};
all a[1001];
double average=0,sum=0;
bool bo(all x,all y){
	return x.money>y.money;
}

int main(){
	for(int i=0;i<10;i++){
		cin>>a[i].number>>a[i].name>>a[i].money;
	}
	for(int i=0;i<10;i++){
		sum+=a[i].money;
	}
	average=sum/10.0;
	sort(a,a+10,bo);
	for(int i=9;i>=0;i--){
		if(a[i].money>=average){
			cout<<a[i].number<<" "<<a[i].name<<" ";
			printf("%.2f\n",a[i].money);
		}
	}
}